<?php
    $ads = $this->Session->read('ServicesRotatingAds');
    if(empty($ads)) {
      $ads= $this->requestAction(array('controller'=>'rotatingAds', 'action'=>'servicesAds'));
    }
?>

<?php if (!empty($ads['list1'])) { ?>
<div class="row-fluid" style="clear:both;">
  <div class="span12">
    <div id="ad1">
  <?php foreach ($ads['list1'] as $ad) { ?>
  <div class="rotatingAd">
    <div class="rotatingAdPhoto"><?php if (!empty($ad['RotatingAd']['image_path'])){ echo $this->Html->image($ad['RotatingAd']['image_path']);} ?></div>
    <div class="rotatingAdText"><?php echo $ad['RotatingAd']['ad_text']; ?></div>
  </div>
  <?php } ?>
    </div>
  </div>
</div>
<?php } ?>

<?php if (!empty($ads['list2'])) { ?>
<div class="row-fluid">
  <div class="span12">
<div id="ad2">
  <?php foreach ($ads['list2'] as $ad) { ?>
  <div class="rotatingAd">
    <div class="rotatingAdPhoto"><?php if (!empty($ad['RotatingAd']['image_path'])){  echo $this->Html->image($ad['RotatingAd']['image_path']);} ?></div>
    <div class="rotatingAdText"><?php echo $ad['RotatingAd']['ad_text']; ?></div>
  </div>
  <?php } ?>
</div>
  </div>
</div>
<?php } ?>

